package day06.dto;

/**
 * @Auther: sky
 * @Date: 2019/2/28 23:05
 * @Description:
 */
public class TreeDTO implements Comparable{

    private int i;
    private int a;

    public int getI() {
        return i;
    }

    public void setI(int i) {
        this.i = i;
    }

    public int getA() {
        return a;
    }

    public void setA(int a) {
        this.a = a;
    }

    @Override
    public int compareTo(Object o) {

        TreeDTO treeDTO = (TreeDTO)o;
        int num= new Integer(this.a).compareTo(new Integer(treeDTO.a));

        return num==0?new Integer(this.i).compareTo(new Integer(treeDTO.i)):num;
    }
}